package com.kairos.utils.monitor 
{
	import com.kairos.engine.RTEvent;	
	import com.kairos.engine.RTBeacon;	
	import com.kairos.utils.monitor.AbstractAverageField;
	import com.bourre.structures.Range;	

	/**
	 * @author Cédric Néhémie
	 */
	public class AverageBeaconProcessTimeField extends AbstractAverageField 
	{
		private var beacon : RTBeacon;

		public function AverageBeaconProcessTimeField ( name : String = "Average Beacon Process Time", 
														beacon : RTBeacon = null, 
														dr : Range = null, 
														limit : int = 20, 
														col : Number = NaN)
		{
			super( name, 0, "ms", dr, limit, col );
			this.beacon = beacon ? beacon : RTBeacon.getInstance();
		}
		override public function registerValue( e : RTEvent ) : void
		{
			_registerValue( isNaN( beacon.lastProcessTime ) ? 0 : beacon.lastProcessTime );
		}
	}
}
